package cn.controller.marketing;

import cn.service.marketingService.MarketingServiceImpl.SeckillTimeServiceImpl;
import entity.Result;
import entity.marketingEntity.SeckillTime;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 朱颢阳
 * @description
 * @time 2024/8/31 14:01
 */
@RestController
@CrossOrigin
@RequestMapping("/marketing")
public class SeckillTimeController {
    @Autowired
    SeckillTimeServiceImpl service;

    @RequestMapping("/gettimes")
    public Result gettimes() {
        return service.gettimes();
    }
    @RequestMapping("/updatetimesstate")
    public Result updatetimesstate(Integer id,Integer state) {
        return service.updatetimesstate(id,state);
    }
    @RequestMapping("/addtimes")
    public Result addtimes(@RequestBody SeckillTime seckillTime) {
        return service.addtimes(seckillTime);
    }
    @RequestMapping("/modifytimes")
    public Result modifytimes(@RequestBody SeckillTime seckillTime) {
        return service.modifytimes(seckillTime);
    }
    @RequestMapping("/deletetimes")
    public Result deletetimes(Integer id) {
        return service.deletetimes(id);
    }
    @RequestMapping("/getflashlist")
    public Result getflashlist(Integer id) {
        return service.getflashlist(id);
    }
}
